window.tools={};
window.tools.getKey=function(){
 var key={};
 window.addEventListener("keydown",function(e){
  if(e.keyCode==38 || e.keyCode==87){
   key.direction="up";
  }else if(e.keyCode==39 || e.keyCode==68){
   key.direction="right";
  }else if(e.keyCode==40 || e.keyCode==83){
   key.direction="down";
  }else if(e.keyCode==37 || e.keyCode==65){
   key.direction="left";
  }else{
   key.direction="";
  }
 },false);
 return key;
}
